import { BaiduImageryLayerProvider } from "./provider/BaiduImageryLayerProvider";
import { register } from "../../utils/Layer";
import { BaseTileLayer } from "./BaseTileLayer";

export class BaiduLayer extends BaseTileLayer {
  //构建ImageryProvider
  _createImageryProvider(options) {
    return createImageryProvider(options)
  }
}

function createImageryProvider(options) {
  return new BaiduImageryLayerProvider(options)
}
/**
 * 创建用于图层的 ImageryProvider对象
 *
 * @param {Object} options Provider参数，同图层构造参数。
 * @return {*} ImageryProvider类
 * @function
 */
BaiduLayer.createImageryProvider = createImageryProvider

//注册下
const layerType = 'baidu' //图层类型
register(layerType, BaiduLayer)